<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">



    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">器械类型:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]" >
                {foreach name="stypeList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">器械名称:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">器械型号:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-model"  class="form-control" name="row[model]" type="text" value="{$row.model|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">展示图片:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}" placeholder="建议尺寸：500x500px">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-logo_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">一句话简介:</label>
        <div class="col-xs-12 col-sm-8">
			 <input id="c-desc" data-rule="required" class="form-control"  name="row[desc]" type="text" value="{$row.desc|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">服务详情:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Sale_type')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="checkbox">
                <?php $saleTypes = is_array($row['saletype']) ? $row['saletype'] : explode(',', $row['saletype']); ?>
                <label><input type="checkbox" id="sale-type-rent" name="row[saletype][]" value="rent" <?php echo in_array('rent', $saleTypes) ? 'checked' : ''; ?>> 租赁</label>
                <label><input type="checkbox" id="sale-type-sale" name="row[saletype][]" value="sale" <?php echo in_array('sale', $saleTypes) ? 'checked' : ''; ?>> 销售</label>
            </div>
        </div>
    </div>
    <div class="form-group rent-field" style="<?php echo !in_array('rent', $saleTypes) ? 'display:none;' : ''; ?>">
        <label class="control-label col-xs-12 col-sm-2">价格:</label>
        <div class="col-xs-12 col-sm-8">

			<div class="input-group">
				<div class="input-group-addon">日租价格（元）</div>
				<input id="c-price" class="form-control" step="0.01" name="row[price]" type="number" value="{$row.price}">
				<div class="input-group-addon">押金价格（元）</div>
				<input id="c-yajin"  class="form-control" step="0.01" name="row[yajin]" type="number" value="{$row.yajin}">
			</div>

        </div>
    </div>

    <div class="form-group sale-field" style="<?php echo !in_array('sale', $saleTypes) ? 'display:none;' : ''; ?>">
        <label class="control-label col-xs-12 col-sm-2">价格:</label>
        <div class="col-xs-12 col-sm-8">

			<div class="input-group">
                <div class="input-group-addon">售卖价格（元）</div>
				<input id="c-saleprice"  class="form-control" step="0.01" name="row[saleprice]" type="number" value="{$row.saleprice}">
			</div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">库存:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-stock" data-rule="required" class="form-control"  name="row[stock]" type="text" value="{$row.stock}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">权重:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" data-rule="required" class="form-control"  name="row[weigh]" type="text" value="{$row.weigh}">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
